package com.example.runtimepermissiontest;

import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;

import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

public class PermissionUtil {


    public static boolean checkPermission(Context context,String permission){
        return ContextCompat.checkSelfPermission(context,permission)
                == PackageManager.PERMISSION_GRANTED;
    }

    public static void getPermission(Activity activity,String[] permissions,int requestCode){
        ActivityCompat.requestPermissions(activity,permissions,requestCode);
    }

}
